project(Graphics2d)

file(GLOB_RECURSE SRC *.cpp *.h *.hpp 3rdparty/glad/src/glad.c)

add_library(Graphics2d STATIC ${SRC})

add_subdirectory(3rdparty)

target_link_libraries(Graphics2d PUBLIC #glad 
                                        glfw 
                                        stb_image)

target_include_directories(Graphics2d PUBLIC ./include
                                             3rdparty/glad/include 
                                             3rdparty/glfw/include 
                                             3rdparty/stb_image/include
                                             3rdparty/glm)


#link opengl
if(WIN32)
    target_link_libraries(Graphics2d PUBLIC opengl32.lib)
elseif(UNIX)
    target_link_libraries(Graphics2d PUBLIC libGL.so)
else()
    message(FATAL_ERROR "Don't support this platform!")
endif()